﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Microsoft_Phone_Controls_Maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
	x:Class="GoogleWeather.MainPage"
	d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
	SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
	shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="ItemTemplate">
			<StackPanel>
				<TextBlock Text="{Binding City}"/>
				<TextBlock Text="{Binding Condition}"/>
				<TextBlock Text="{Binding Humidity}"/>
				<TextBlock Text="{Binding TempC}"/>
				<TextBlock Text="{Binding TempF}"/>
				<Image Source="{Binding WeatherImage}" HorizontalAlignment="Right" Height="64" Width="64"/>
				<TextBlock Text="{Binding Wind}"/>
			</StackPanel>
		</DataTemplate>
		<DataTemplate x:Key="ItemTemplate1">
			<Grid>
				 <Grid.RowDefinitions>
                                <RowDefinition Height="80"/>
                                <RowDefinition />
                                <RowDefinition />
								<RowDefinition />
								<RowDefinition />
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="90" />
                                <ColumnDefinition Width="70"/>
                                <ColumnDefinition Width="180"/>
                                <ColumnDefinition Width="90"/>
                            </Grid.ColumnDefinitions>
				<TextBlock x:Name="dayofweek" Text="{Binding DayOfWeek}" VerticalAlignment="Bottom" d:LayoutOverrides="Width" Foreground="LightBlue"  FontSize="40" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4"/>
                <Image Source="http://www.google.com/ig/images/weather/haze.gif" Grid.Column="3" Grid.Row="0" Height="80" Width="80" HorizontalAlignment="Right" />
                <TextBlock Text="Temp"  FontSize="30" Foreground="LightBlue" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="4"/>
				<TextBlock x:Name="tempC" Text="{Binding TempC}" FontSize="30" Foreground="White" Grid.Column="1" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
				<TextBlock x:Name="tempF" Text="{Binding TempF}" FontSize="30" Foreground="White" Grid.Column="2" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
				<TextBlock x:Name="condition" Text="{Binding Condition}" Foreground="LightBlue" VerticalAlignment="Bottom" d:LayoutOverrides="Width" Grid.Row="2" Grid.Column="0" TextWrapping="Wrap" Grid.ColumnSpan="4"/>
				<TextBlock x:Name="humidity" Text="{Binding Humidity}" Foreground="White" VerticalAlignment="Bottom" d:LayoutOverrides="Width" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" />
				<TextBlock x:Name="wind" Text="{Binding Wind}" Foreground="LightBlue" VerticalAlignment="Bottom" d:LayoutOverrides="Width" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" />
			</Grid>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{Binding Source={StaticResource Weather}}">
		<!--Pivot Control-->
		<controls:Pivot x:Name="pivotWeather" Title="Techknackblogs">
			<controls:PivotItem x:Name="City" Header="City">
				<Grid>
					<TextBox x:Name="txtCity" Margin="8,22,91,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
					<Button x:Name="btnGo" Content="Go" HorizontalAlignment="Right" Margin="0,25,8,0" VerticalAlignment="Top" Click="btnGo_Click"/>
                </Grid>
			</controls:PivotItem>
			<controls:PivotItem x:Name="CurrentWeather" Header="Weather">
				<Grid>
					<ListBox x:Name="lstWeather" ItemTemplate="{StaticResource ItemTemplate1}" ItemsSource="{Binding Collection}"/>
				</Grid>
			</controls:PivotItem>
			<controls:PivotItem x:Name="Forecast" Header="Forecast">
				<Grid>
					<ListBox x:Name="lstForecast" HorizontalAlignment="Right" ItemTemplate="{StaticResource ItemTemplate1}" ItemsSource="{Binding Collection}"/>
				</Grid>
			</controls:PivotItem>
			<controls:PivotItem x:Name="BingMap" Header="City Map">
				<Grid>
					<Microsoft_Phone_Controls_Maps:Map x:Name="bingMapItem" d:LayoutOverrides="Width, Height" ZoomBarVisibility="Visible" ScaleVisibility="Visible">
                    </Microsoft_Phone_Controls_Maps:Map>
                </Grid>
			</controls:PivotItem>
			<!--Pivot item one-->

			<!--Pivot item two-->
		</controls:Pivot>
	</Grid>
</phone:PhoneApplicationPage>
